<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>首页</title>

</head>
<body>
<div class="table-responsive">
    <h2><a th:href="@{/emp}" class="btn btn-success">发布信息</a></h2>
    <table class="table table-striped table-sm">
        <thead>
        <tr>
            <th>房屋编号</th>
            <th>房屋描述</th>
            <th>户型名</th>
            <th>租金</th>
            <th>发布日期</th>
        </tr>
        </thead>
        <tbody>
        <tr th:each="emp:${houses}">
            <td th:text="${emp.houseId}">1,001</td>
            <td th:text="${emp.houseDesc}">Lorem</td>
            <td th:text="${emp.houseId}">ipsum</td>
            <td th:text="${emp.monthlyRent}">dolor</td>
            <td th:text="${emp.publishDate}">dolor</td>
        </tr>
        </tbody>
    </table>
    <nav>
        <ul class="pagination">
            <li th:class="${currentPage == 1 ? 'disabled' : ''}">
                <a th:href="@{/houseManager/list(pageIndex=1)}">首页</a >
            </li>
            <li th:class="${currentPage == 1 ? 'disabled' : ''}">
                <a th:href="@{/houseManager/list(pageIndex=${currentPage - 1})}">上一页</a >
            </li>
            <li th:each="pageNum : ${#numbers.sequence(1, totalPages)}"
                th:class="${pageNum == currentPage ? 'active' : ''}">
                <a th:href="@{/houseManager/list(pageIndex=${pageNum})}" th:text="${pageNum}"></a >
            </li>
            <li th:class="${currentPage == totalPages ? 'disabled' : ''}">
                <a th:href="@{/houseManager/list(pageIndex=${currentPage + 1})}">下一页</a >
            </li>
            <li th:class="${currentPage == totalPages ? 'disabled' : ''}">
                <a th:href="@{/houseManager/list(pageIndex=${totalPages})}">末页</a >
            </li>
        </ul>
    </nav>

</div>
</body>
</html>